package com.boot.security.server.dao.order;

import java.util.List;
import java.util.Map;

import com.boot.security.server.model.order.TswOrderLogistics;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;



@Mapper
public interface TswOrderLogisticsDao {

    @Select("select * from tsw_order_logistics t where t.id = #{id}")
    TswOrderLogistics getById(Long id);

    @Delete("delete from tsw_order_logistics where id = #{id}")
    int delete(Long id);

    int update(TswOrderLogistics tswOrderLogistics);
    
    @Options(useGeneratedKeys = true, keyProperty = "id")
    @Insert("insert into tsw_order_logistics(order_id, logistics_mode, single_number, sys_user_id, delivery_time, logistics_note, logistics_remark) values(#{orderId}, #{logisticsMode}, #{singleNumber}, #{sysUserId}, #{deliveryTime}, #{logisticsNote}, #{logisticsRemark})")
    int save(TswOrderLogistics tswOrderLogistics);
    
    int count(@Param("params") Map<String, Object> params);

    List<TswOrderLogistics> list(@Param("params") Map<String, Object> params, @Param("offset") Integer offset, @Param("limit") Integer limit);
}
